import request from '@/utils/request';

export function getDicts(dictType) {
  return request({
    url: '/system/dictData/dictType/' + dictType,
    method: 'get',
  });
}

// 查询字典数据详细
export function getDictData(id) {
  return request({
    url: '/system/dictData/queryById/' + id,
    method: 'get',
  });
}

// 查询字典数据列表
export function listDictData(query) {
  return request({
    url: '/system/dictData/queryList',
    method: 'get',
    params: query,
  });
}

// 查询已发布的字典数据列表
export function queryRelease(params) {
  return request({
    url: '/system/dictData/queryRelease',
    method: 'get',
    params,
  });
}

// 查询逻辑删除的字典数据列表
export function queryRecycle(params) {
  return request({
    url: '/system/dictData/queryRecycle',
    method: 'get',
    params,
  });
}

// 新增字典数据
export function addDictData(data) {
  return request({
    url: '/system/dictData/insert',
    method: 'post',
    data: data,
  });
}

// 修改字典数据
export function updateDictData(data) {
  return request({
    url: '/system/dictData/updateById',
    method: 'put',
    data: data,
  });
}

// 根据id批量审核
export function auditByIds(ids) {
  return request({
    url: '/system/dictData/auditByIds/' + ids,
    method: 'put',
  });
}

// 根据id批量反审核
export function unauditByIds(ids) {
  return request({
    url: '/system/dictData/unauditByIds/' + ids,
    method: 'put',
  });
}
// 导出当前查询列表
export function exports(params) {
  return request({
    url: '/system/dictData/export',
    method: 'post',
    params,
  });
}

// 删除字典数据
export function delDictData(ids) {
  return request({
    url: '/system/dictData/deleteByIds/' + ids,
    method: 'delete',
  });
}

// 根据id批量还原删除的字典数据
export function recoverByIds(ids) {
  return request({
    url: '/system/dictData/recoverByIds/' + ids,
    method: 'put',
  });
}
// 根据id批量逻辑删除字典数据
export function removeByIds(ids) {
  return request({
    url: '/system/dictData/removeByIds/' + ids,
    method: 'delete',
  });
}
